{extend name='public/layout' /}
{block name='content'}

<div class="main m_t_15">
    <div class="position"><p><span>更新时间：{:date("Y年m月d日")}</span>您当前的位置：<a href="{:url('Index/index')}">{$site.title}</a> > <a href="{:url('Tuangou/index')}">团购</a></p></div>
    <div class="m_t_15 overflow_h">
        {volist name='lists' id='vo' empty='暂无数据'}
        <div class="group_list">
            <span class="group_img">
                <a href="{:url('Tuangou/detail',['id'=>$vo.id])}" title="{$vo.title}">
                    <img data-original="{$vo.img}" alt="{$vo.title}" src="__IMG__/loading.gif" class="lazy" width="375" height="280">
                </a>
            </span>
            <div class="group_l_r">
                <div class="overflow_h">
                    <div class="group_l_r1">
                        <div class="group_l_r1_m1">
                            <b><a href="{:url('Tuangou/detail',['id'=>$vo.id])}" title="{$vo.title}">{$vo.title} </a></b>
                            <p><span class="gr_add">楼盘位置：{$cityCate[$vo.city]['name']} {$cityCate[$vo.area]['name']}</span><span>均价：{$vo.old_price}元/平米</span><span>团购价：{$vo.price}元/平米</span></p>
                        </div>
                        <div class="group_l_r1_m2">
                            <p>{$site.title}团购优惠：</p>
                            <b>{$vo.youhui}</b>
                            <p><span><a href="{:url('Tuangou/detail',['id'=>$vo.id])}">了解详情</a></span></p>
                        </div>
                    </div>
                    <div class="group_l_r2">

                        <p><span class="text19">已有{$vo.buy_num}</span>人报名</p>
                        <a href="javascript:;" data-uri="{:url('Ajax/tuangou',['id'=>$vo['id'],'type'=>4])}" class="J_dialog but19">团购报名</a>
                    </div>
                </div>
                <div class="group_l_r3">
                    <span class="group_time time-remain" data-down="{$vo.end_time-time()}">活动结束剩余<i class="text20" time_id="d">0</i> 天 <i class="text20" time_id="h">0</i> 小时 <i class="text20" time_id="m">0</i>分钟  <i class="text20" time_id="s">0</i>秒</span>
                </div>
            </div>
        </div>
        {/volist}

        <div class="plastic_bottom_pages">{$pages}</div>

    </div>



</div>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    $(function(){
        setTimeout(takeCount,1000);
    });
    function takeCount() {
        setTimeout("takeCount()", 1000);
        $(".time-remain").each(function(){
            var obj = $(this);
            var tms = obj.data("down");
            if (tms>0) {
                tms = parseInt(tms)-1;
                var days = Math.floor(tms / (1 * 60 * 60 * 24));
                var hours = Math.floor(tms / (1 * 60 * 60)) % 24;
                var minutes = Math.floor(tms / (1 * 60)) % 60;
                var seconds = Math.floor(tms / 1) % 60;

                if (days < 0) days = 0;
                if (hours < 0) hours = 0;
                if (minutes < 0) minutes = 0;
                if (seconds < 0) seconds = 0;
                obj.find("[time_id='d']").html(days);
                obj.find("[time_id='h']").html(hours);
                obj.find("[time_id='m']").html(minutes);
                obj.find("[time_id='s']").html(seconds);
                obj.data("down",tms);
            }
        });
    }
</script>
<script>
    $(function(){
        $('.J_dialog').bind('click',function(){
            var url = $(this).data('uri');
            layer.open({
                type: 2,
                title: false,
                area: ['500px', '400px'],
                shade: 0,
                closeBtn: 1,
                shadeClose: true,
                content:url
            });
        });
    });
</script>
{/block}